<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="UTF-8">
		<title>流程管理</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="${resource }/css/bootstrap.css" />
		<link rel="stylesheet" type="text/css" href="${resource }/css/iconfont.css">
		<script src="${resource }/js/jquery-2.1.1.min.js"></script>
		<script src="${resource }/js/jquery.form.js"></script>
		<script src="${resource }/js/bootstrap.min.js?v=3.4.0"></script>
	</head>

	<body>
		<div class="row wrapper border-bottom white-bg page-heading">
			<div class="col-sm-4">
				<h2>流程管理</h2>
				<ol class="breadcrumb">
					<li>
						<a href="index.html">主页</a>
					</li>
					<li>
						<strong>步骤列表</strong>
					</li>
				</ol>
			</div>
		</div>
		<div class="row wrapper border-bottom white-bg page-heading">
			<div class="col-md-12">
				<!-- 用户列表--bootstrap高级表格使用 -->
				<div class="panel panel-default">
					<div class="panel-heading">
						步骤列表
					</div>
					<div class="panel-body">
						<!--table-responsive响应式表格，会自动添加滚动条-->
						<div class="table-responsive">
							<a href="../workFlow/show.do"><input class="btn btn-success" type="button" value="返回上一步" style="float: left;"></a>
							<a href="addstep.do?workfowid=${workflowid}"><input class="btn btn-success" type="button" value="添加步骤" style="float: right;"></a>
							<table class="table">
								<thead>
									<tr>
										<th>编号</th>
										<th>步骤</th>
										<th>详情</th>
										<th>所属流程</th>
										<th>序号</th>
										<th>审核人</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								<c:forEach items="${list}" var="step">
									<tr class="odd gradeX">
										<td>${step.id}</td>
										<td>${step.stepName}</td>
										<td>${step.stepInfo}</td>
										<td>${step.workflow.workflowName}</td>
										<td>${step.stepNum}</td>
										<td>${step.user.userName}</td>
										<td>
											<a title="修改"  class="t-edit" href="editstep.do?id=${step.id}"><i class="iconfont icon-shuru"></i></a>
											<a title="删除" class="t-del" onclick="ifdelete('${step.id}')"><i class="iconfont icon-shanchu"></i></a>
										</td>
									</tr>
								</c:forEach>
								</tbody>
							</table>
						</div>

						
					</div>
				</div>
				<!--表格结束 -->
			</div>
		</div>
		<script>
			function ifdelete(x) {
				var rs = confirm("您确定删除该流程吗？");
				if (rs) {
					$.ajax({
						type:'post',
						data:{"id":x},
						url:'deletstep.do',
						success:function(data){
							if (data!="0") {
								 window.location.href="show.do?id="+data;
							} else {
								alert("操作失败");
							}
						}
					});
				}
			}
		</script>
	</body>

</html>